package com.etc.medical.client;

import com.etc.common.utils.Result;
import com.etc.cure.entity.Hospital;
import com.etc.medical.breaker.HospitalBreak;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "sp-cure", fallback = HospitalBreak.class)
public interface HospitalClient {
    /**
     * 查询医生Id下的所有的住院病人信息
     */
    @RequestMapping("/inHospital/queryByDocId")
    Result queryByDocId(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                        @RequestParam("docId") String docId);

    /**
     * 根据门诊Id查询住院病人信息
     */
    @RequestMapping("/inHospital/queryByOsId")
    Result queryByOsId(@RequestParam("osId") String osId);

    /**
     * 新增住院病人信息
     */
    @RequestMapping(value = "/inHospital/insert", method = RequestMethod.POST)
    Result insert(@RequestParam("osId") String osId, @RequestParam("docId") String docId);

    /**
     * 修改住院病人信息
     */
    @RequestMapping(value = "/inHospital/update", method = RequestMethod.POST)
    Result update(@RequestBody Hospital hospital, @RequestParam("docId") String docId);
}
